package com.ssy.lingxi.order.repository;

import com.ssy.lingxi.order.entity.OrderDO;
import com.ssy.lingxi.order.entity.OrderRequirementDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * 订单其他要求Jpa仓库
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-20
 */
@Repository
public interface OrderRequirementRepository extends JpaRepository<OrderRequirementDO, Long>, JpaSpecificationExecutor<OrderRequirementDO> {
    OrderRequirementDO findFirstByOrder(OrderDO order);

    @Transactional
    void deleteByOrder(OrderDO order);
}
